﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Administration/Views/Shared/Administration.Master" Inherits="System.Web.Mvc.ViewPage<MotorcycleStore.MVC.Administration.ViewModels.MotorcycleModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Create
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Create</h2>

    <% using (Html.BeginForm()) {%>

        <fieldset>
            <legend>Motorcycle Fields</legend>
            <%: Html.ValidationSummary(true) %>
            <div class="editor-label">
                <%: Html.LabelFor(m => m.Motorcycle.Name) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(m => m.Motorcycle.Name) %>
                <%: Html.ValidationMessageFor(m => m.Motorcycle.Name) %>
            </div>
            
			<div class="editor-label">
				<%: Html.LabelFor(m => m.Motorcycle.ManufacturerId) %>
			</div>
			<div class="editor-field">
				<%: Html.DropDownListFor(m => m.Motorcycle.ManufacturerId, new SelectList(Model.AvailableManufacturers, "Id", "Name"), "Select...") %>
				<%: Html.ValidationMessageFor(m => m.Motorcycle.ManufacturerId) %>
			</div>

			<div class="editor-label">
				<%: Html.LabelFor(m => m.Categories) %>
			</div>
			<div class="editor-field">
				<%: Html.ListBoxFor(model => model.Categories, new SelectList(Model.AvailableCategories, "Id", "Name")) %>
				<%: Html.ValidationMessageFor(model => model.Categories) %>
			</div>

			<div class="editor-label">
				<%: Html.LabelFor(m => m.Motorcycle.Year) %>
			</div>
			<div class="editor-field">
				<%: Html.TextBoxFor(m => m.Motorcycle.Year) %>
			</div>

            <p>
                <input type="submit" value="Create" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

